package org.vidyakiran.app.client.view;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.TextBox;

public class LoginPopup extends PopupPanel {

	private FlexTable mainloginPanel;
	private Label unameLabel;

	private Label passwordLabel;

	private TextBox unameTextBox;

	private PasswordTextBox passwordTextBox;

	private Hyperlink forgotPassword;

	private Hyperlink register;
	
	private Button loginButton;
	
	private Button cancelButton;

	public LoginPopup() {
		mainloginPanel = new FlexTable();
		unameLabel = new Label("Username");
		passwordLabel = new Label("Password");
		unameTextBox = new TextBox();
		passwordTextBox = new PasswordTextBox();
		
		forgotPassword = new Hyperlink();
		forgotPassword.setText("Forgot Password");
		
		register = new Hyperlink();
		register.setText("Register");
		loginButton = new Button("Login");
		cancelButton = new Button("Cancel");
		this.add(createLoginPopup());
	}

	public Panel createLoginPopup(){
		mainloginPanel.setWidget(0, 0, unameLabel);
		mainloginPanel.setWidget(0, 1, unameTextBox);
		mainloginPanel.setWidget(1, 0, passwordLabel);
		mainloginPanel.setWidget(1, 1, passwordTextBox);
		mainloginPanel.setWidget(2, 0, forgotPassword);
		mainloginPanel.setWidget(2, 1, register);
		mainloginPanel.setWidget(3, 0, loginButton);
		mainloginPanel.setWidget(3, 1, cancelButton);
		return mainloginPanel;
	}

	public FlexTable getMainloginPanel() {
		return mainloginPanel;
	}

	public Label getUnameLabel() {
		return unameLabel;
	}

	public Label getPasswordLabel() {
		return passwordLabel;
	}

	public TextBox getUnameTextBox() {
		return unameTextBox;
	}

	public PasswordTextBox getPasswordTextBox() {
		return passwordTextBox;
	}

	public Hyperlink getForgotPassword() {
		return forgotPassword;
	}

	public Hyperlink getRegister() {
		return register;
	}

	public Button getLoginButton() {
		return loginButton;
	}

	public Button getCancelButton() {
		return cancelButton;
	}

}
